package Teacher;

public class JavaTeacher {
    private String name, //姓名
            gender;//性别
    private int age,//年龄
            aa;//教龄

    public String getName() {
        return name;
    }

    public String getGender() {
        return gender;
    }

    public int getAge() {
        return age;
    }

    public int getAa() {
        return aa;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setGender(String gender) {
        if (gender.equals("男")||gender.equals("女")){
            this.gender = gender;
        }else {
            System.out.println("性别输入错误,默认为男");
            this.gender="男";
        }

    }

    public void setAge(int age) {
        if (age>0&&age<120){
            this.age = age;
        }else {
            System.out.println("年龄输入错误,默认为20岁");
            this.age=20;
        }

    }

    public void setAa(int aa) {
        this.aa = aa;
    }

    public void selfIntroduce() {
        System.out.println("大家好我是" + name + "老师，今年" + age + "岁了,性别:" + gender + ",教龄为：" + aa + "年");
    }

    final void giveLession() {
        System.out.println("今天教java");
    }
}
